package cate.game.role.bag.fairy;

import cate.common.table.d.GDBag;
import cate.common.table.d.GDObj;
import cate.common.table.item.fairy.row.FairyBaseRow;
import cate.game.role.Role;
import cate.game.role.bag.BagContainer;
import cate.game.role.bag.fairy.msg.FairyAddResp;
import cate.game.role.bag.item.msg.ItemAddResp;
import com.fasterxml.jackson.annotation.JsonIgnore;
import easy.java.dev.note.NoteClass;

@NoteClass(value = "灵器背包")
public class FairyBag extends BagContainer<Fairy> {
    public FairyBag(){

    }

    public FairyBag(Role role){
        super(role);
    }

    @Override
    public int calcCapacity() {
        return GDBag.Capcity.FAIRT;
    }

    @Override
    protected ItemAddResp createItemAddMsg() {
        return new FairyAddResp();
    }

    @Override
    protected Fairy createItem(int tid, long num) {
        return new Fairy(role, tid, num);
    }

    @Override
    protected byte getItemType() {
        return GDObj.Type.FAIRY;
    }

    @Override
    @JsonIgnore
    public FairyBaseRow getItemTpl(int templateId) {
        return role.getGame().table.fairy.base.get(templateId);
    }
}
